//
//  ViewController.m
//  Journey
//
//  Created by dllo on 16/5/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "RecommendViewController.h"
@interface ViewController ()
@property(nonatomic,strong)UIScrollView *scrollView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //新用户引导页
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    scrollView.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:scrollView];
    self.scrollView = scrollView;
    scrollView.contentSize = CGSizeMake(WIDTH *4, 0);
    
    for (int i = 1; i < 5; i++) {
        UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.jpg",i]]];
        image.frame = CGRectMake((i - 1) * WIDTH, 0, WIDTH, HEIGHT);
        image.userInteractionEnabled = YES;
        [self.scrollView addSubview:image];
    }
    //按页滑动
    
    self.scrollView.pagingEnabled = YES;
    //隐藏水平滚动条
    self.scrollView.showsHorizontalScrollIndicator = NO;
    //关闭回弹效果
    self.scrollView.bounces = NO;
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(WIDTH * 3 + 0.3 * WIDTH, HEIGHT - 185, 250, 185);
    [button addTarget:self action:@selector(button1Action) forControlEvents:UIControlEventTouchUpInside];
    [self.scrollView addSubview:button];
 
    
}

-(void)button1Action{
    
    [self presentViewController:self.tabBar animated:YES completion:^{
        
        
    }];
 
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
